function InputDialog(div, handler) {

    var self = this;
	this.handler = handler;

    this.init = function() {
//        console.log($(div).html());
        var formHtml = '<div id="' + div + 'Title"></div><div><table class="table-layout" width="100%">' +
            '<tr><td colspan="2"><input id="' + div + 'InputField" type="text" /></td></tr>' +
            '<tr><td><input id="' + div + 'SubmitBtn" type="button" value="OK" /></td><td><input id="' + div + 'CancelBtn" type="button" value="Отмена" /></td></tr>' +
            '</table></div>';
        $('#' + div).html(formHtml);
        $('#' + div + 'InputField').jqxInput({ width: 150, height: 22 });
        $('#' + div + 'SubmitBtn').jqxButton({ width: 70 }).on('click', function() {
            var value = $('#' + div + 'InputField').val();
            if(value != null && $.trim(value).length) {
	            if(self.handler != null) {
		            self.handler(value);
	            }
                self.close();
            }
        });
        $('#' + div + 'CancelBtn').jqxButton({ width: 70 }).on('click', function() {
            self.close();
        });
        $('#' + div).jqxWindow({ resizable: false, draggable: true, isModal: true, autoOpen: false, width: 200, height: 120 });
    };

    this.show = function(title, value) {
        $('#' + div + 'Title').html(title);
        $('#' + div).jqxWindow('open');
        $('#' + div + 'InputField').jqxInput('val', value );
        $('#' + div + 'InputField').jqxInput('focus');
    };

    this.close = function() {
        $('#' + div).jqxWindow('close');
    };
};
